home *** CD-ROM | disk | FTP | other *** search
- From: kanze@gabi-soft.fr (J. Kanze)
- Message-ID: <KANZE.96Mar29114545@gabi.gabi-soft.fr>
- X-Original-Date: 29 Mar 1996 10:45:45 GMT
- Path: in2.uu.net!bounce-back
- Date: 01 Apr 96 08:36:42 GMT
- Approved: fjh@cs.mu.oz.au
- Newsgroups: comp.std.c++
- Subject: Re: static members as members of a metaclass h
- Organization: GABI Software, Sarl.
- References: <4jc5lt$doh@arl-news-svc-2.compuserve.com> <4jckdc$ad6@engnews1.Eng.Sun.COM>
- In-Reply-To: clamage@Eng.Sun.COM's message of 28 Mar 96 09:26:03 GMT
- X-Auth: PGPMoose V1.1 PGP comp.std.c++
- iQBFAgUBMV+VteEDnX0m9pzZAQHi+wGAnx1rr9dCkaLgqsJb7QRpyIvy8bI/Bak9
- 4zDP0w0KB0ImwKsoXiePGYkfUdritwq9
- =eKz/
-
- In article <4jckdc$ad6@engnews1.Eng.Sun.COM> clamage@Eng.Sun.COM (Steve
- Clamage) writes:
-
- [...]
- |> I believe a reasonable solution to the problem of initialization of
- |> non-local static data is not to use non-local static data!
-
- |> Instead of a static data object or static class data member, use a
- |> function with a local static object.
- [...]
- |> Only two features are missing, compared to non-local static objects:
-
- |> 1. If you never reference an object, it is never initialized.
-
- But is this guaranteed by the standard anyway? I know that I have a
- significant number of static objects which must be initialized before
- main (but in any order), but I have always believed that this works
- because of the way current compilers work, and not because of anything
- in the standard.
-
- |> 2. The order of destruction remains unspecified. If that is a problem,
- |> possibly the static objects could be of a type which has a do-nothing
- |> destructor and a "destroy" member function which could be called
- |> explicitly at the proper time.
-
- I thought that the order of destruction was the reverse of
- initialization. This is what it says in the January draft, at least.
- Has this been changed?
- --
- James Kanze (+33) 88 14 49 00 email: kanze@gabi-soft.fr
- GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
- Conseils en informatique industrielle --
- -- Beratung in industrieller Datenverarbeitung
- ---
- [ comp.std.c++ is moderated. To submit articles: try just posting with ]
- [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
- [ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
- [ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
- [ Comments? mailto:std-c++-request@ncar.ucar.edu ]
-